# coding: utf8
import os
from flask_uploads import IMAGES


class Config(object):
    SQLALCHEMY_ECHO = False
    SQLALCHEMY_DATABASE_URI = "mysql://root:root@127.0.0.1:3306/17det?charset=utf8"
    SQLALCHEMY_COMMIT_ON_TEARDOWN = False
    SQLALCHEMY_TRACK_MODIFICATIONS = True
    SECRET_KEY = "SECRET_KEY"
    SSRF_ENABLE = True

    UPLOADED_PHOTO_DEST = os.getcwd() + '/uploads/images/'
    UPLOADED_PHOTO_ALLOW = IMAGES

    LOGIN_QR_PATH = os.getcwd() + '/qr/'
    ROOT_DIR = os.getcwd()


class CodeMap(object):
    SUCCESS = 200
    SUCCESS_MSG = u'成功'
    PARAMS_ERROR = -1
    PARAMS_ERROR_MSG = u'参数错误'
    MYSQL_ERROR = -2
    MYSQL_ERROR_MSG = u'数据库错误'
    SYSTEM_ERROR = -3
    SYSTEM_ERROR_MSG = u'系统错误'

    LOGIN_ERROR = -4
    LOGIN_ERROR_MSG = u'账号密码错误'
